package com.originskyseed.platform.course.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.originskyseed.platform.course.model.CourseType;

/**
 * 课程类型表Mapper类（OSI_COURSE_TYPE）
 * 
 * @author Tangwanghui
 */
public interface CourseTypeMapper {

	/**
	 * 删除记录
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int deleteByPrimaryKey(String id) throws Exception;

	/**
	 * 批量删除记录
	 * 
	 * @param ids
	 * @return
	 * @throws Exception
	 */
	public int deleteByPrimaryKeys(List<String> ids) throws Exception;

	/**
	 * 批量更新删除状态
	 *
	 * @param ids
	 * @return
	 * @throws Exception
	 */
	public int updateDelByIds(List<String> ids) throws Exception;

	/**
	 * 更新置顶记录
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int updateIsTop(CourseType record) throws Exception;

	/**
	 * 插入记录
	 * 
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int insert(CourseType record) throws Exception;

	/**
	 * 插入记录（仅非空值字段）
	 * 
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int insertSelective(CourseType record) throws Exception;

	/**
	 * 更新记录
	 * 
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int updateByPrimaryKey(CourseType record) throws Exception;

	/**
	 * 更新记录（仅非空值字段）
	 * 
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int updateByPrimaryKeySelective(CourseType record) throws Exception;

	/**
	 * 查询记录
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public CourseType selectByPrimaryKey(String id) throws Exception;

	/**
	 * 查询列表
	 * 
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public List<CourseType> selectList(CourseType record) throws Exception;

	/**
	 * 分页查询列表
	 * 
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public List<CourseType> selectListByPage(Map<String, Object> params) throws Exception;

	/**
	 * 查询课程类型id是否存在
	 *
	 * @param courseTypeId
	 * @return
	 * @throws Exception
	 */
	public String selectCourseTypeId(@Param("courseTypeId") String courseTypeId) throws Exception;

	/**
	 * 查询最大优先级
	 * 
	 * @return
	 * @throws Exception
	 */
	public Integer selectPrority() throws Exception;

	/**
	 * 查询优先级
	 * 
	 * @param map
	 * @return
	 * @throws Exception
	 */
	public CourseType selectCourseTypeByPriority(Map<String, Object> map) throws Exception;
}